export default (element) => {

  if (element) {
    if (typeof element === 'string') {
      return document.querySelector(`#${element}`);
    }

    if (typeof element === 'function') {
      return element();
    }

    return element;
  }

  const SKY_CONTAINER = document.querySelector('#sky-root');
  if (!SKY_CONTAINER) {
    throw new Error('Current page does not exist <div id="sky-root"></div> element.');
  }

  return SKY_CONTAINER;

}